window.onload = function () {
    var add = document.getElementById('add')
    var plus = document.getElementById('plus')
    var num = document.getElementById('count').value
    add.onclick = function () {
        num++
        document.getElementById('count').value = num
    }
    plus.onclick = function () {
        if (num <= 1) {
            num = 1
        } else {
            num--
            document.getElementById('count').value = num
        }

    }

    var alls = [[],['所有','不满65cm','65-70cm','70-80cm'],['所有','50-60kg','60-70kg','70-80kg'],['10-20岁','20-30岁','30-40岁'],['20-25','25-30']]
    var choice = document.getElementById('choice')
    var all = document.getElementById('all')
    choice.onchange = function(){
        var index = this.selectedIndex
        all.options.length = 0
        for(var i = 0; i <  alls[index].length; i++){
            var newOption = new Option(alls[index][i],alls[index][i])
            all.options.add(newOption)
        }
    }

    window.onscroll = function(){
        var top = document.documentElement.scrollTop
        if(top > 200){
            document.getElementById('nav').style.display = 'block'
        }else{
            document.getElementById('nav').style.display = 'none'
        }                                                                     
        
    }
}
